perm filename A23.TEX[106,PHY] blob
sn#807731 filedate 1985-11-11 generic text, type C, neo UTF8
COMMENT ā VALID 00002 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00002 00002 \magnification\magstephalf
C00005 ENDMK
Cā;
\magnification\magstephalf
\input macro.tex
\def\today{\ifcase\month\or
January\or February\or March\or April\or May\or June\or
July\or August\or September\or October\or November\or December\fi
\space\number\day, \number\year}
\baselineskip 14pt
\rm
\line{\sevenrm a23.tex[106,phy] \today\hfill}
\bigskip
{\narrower\smallskip\noindent
{\bf Exercise.} (Strings)
\noindent
Given a word {\tt C} from a cryptogram and a word {\tt D} from the dictionary,
determine if there is a cryptographic substitution that changes~{\tt C}
into~{\tt D}. The rules of cryptographic substitution are that no letter
can be substituted for itself, and no letter can be substituted for
more than one letter. Examples:
$$\vcenter{\halign{\ctr{\tt #}\qquad&\ctr{\tt #}\qquad&\ctr{#}\cr
C&D&Answer\cr
\noalign{\smallskip}
ABBAC&TEETH&YES\cr
ABBAC&TRUTH&NO\cr
ABBAC&ARRAY&NO\cr
RQQJY&TEETH&NO\cr}}$$
\smallskip}
{\narrower\smallskip\noindent
{\bf Exercise.} (Strings)
\noindent
Write a program to pretend to be a therapist, reading sentences in English from
the terminal. If an input sentence contains ``am'', the program should respond by
a confirmation, changing ``am'' to ``are'', ``I''~to ``you'', etc.:
\line{\qquad\qquad\qquad Input: I am angry.\hfil}
\line{\qquad\qquad\qquad Output: You say you are angry.\hfil}
It should respond to sentences containing family names, like ``brother'', with
``Tell me more about your family.''
It should respond to ``I don't like (trust, etc.) you'' with ``I'm only trying to
help you.'' If all else fails, it should say ``Yes,'' or ``Go on,'' or the like.
\smallskip}
\bigskip
\parindent0pt
\copyright 1984 Robert W. Floyd
First draft March 28, 1984
\bye